/*
 * @Description  :
 * @Autor        : yanwang
 * @CreateDate   : 2023-04-20 15:35:20
 * @LastEditors  : yanwang
 * @LastEditTime : 2023-04-20 15:47:48
 */
const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
  const apiProxy = createProxyMiddleware('/v1', {
    target: 'https://cproj.mojicb.com/outdoorevents',
    changeOrigin: true, // needed for virtual hosted sites
    ws: true, // proxy websockets
    // pathRewrite: {
    //   "^/v1": ""
    // }
  });

  app.use(apiProxy);
};
